#pragma once
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;

//Define: Stores Globals, loads runtime specific globals from a file;
const string BASEFILE = "";
//Why does this kill the workd?


class Config
{
//I didn't use an array because I would have had to go back and name them all anyways.
public:

 bool DEBUG_MODE;

 int MAX_PLAYERS;

 string HOST_URL;
 string START_LEVEL;



 Config(){
 string option,state;
option = BASEFILE + "Data\\Config.cfg";
 ifstream cfg (option.c_str(),ifstream::in);
 
 while(cfg.good()){
	 while(cfg.peek() != ':'&&cfg.good()){option += cfg.get();}
	 while(cfg.get() != '\"'&&cfg.good()){}
	 while(cfg.peek() != '\"'&&cfg.good()){state += cfg.get();}
	 cfg.get();
		
	
	 if(option == "DEBUG_MODE"){DEBUG_MODE = (state=="true")?true:false;}
	 if(option == "CLIENT_HOST_URL"){HOST_URL = state;}
	 if(option == "SERVER_START_LEVEL"){START_LEVEL = state;}
	 if(option == "SERVER_MAX_PLAYERS"){MAX_PLAYERS = atoi(state.c_str()); if(MAX_PLAYERS < 1){MAX_PLAYERS =1;}}
	 
	}
 }




};